package inter4.service;/*
    @Auther:kongshan
    @Date:2023/6/6-06-06-21:37
    @Description:IntelliJ IDEA
    @version:


*/

import inter4.dao.StudentDao;
import inter4.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class StudentService {
    @Autowired
    StudentDao studentDao;
    //修改


    //显示总记录数
//    public int studentCount(){
//        return studentDao.studentCount();
//    }
//    //分页查询
//    public List<Student> listStudentPage(HashMap map){
//        return studentDao.listStudentPage(map);
//    }

    //根据编号修改
    public int updateStudent(Student student){
        int num=studentDao.updateStudent(student);
        return num;
    }
    //根据编号显示实体
    public Student showStudentByBh(int bh){
        return studentDao.getStudentByBh(bh);
    }
    //显示列表数据
    public List<Student> showAllStudent(){
        return studentDao.showAllStudent();
    }
    //根据编号显示实体
    public Student getStudentByBh(int bh){
        return studentDao.getStudentByBh(bh);
    }

    //实现数据新增
    public int saveStudent(Student student){
        return  studentDao.saveStudent(student);
    }
//    //实现根据编号删除一条数据
//    public int delStudent(int bh){
//        studentDao.delStudent(bh);
//        return bh;
//    }
    //实现数据保存
//    public void saveStudent(Student student){
//        studentDao.saveStudent(student);
//    }
    //    显示所有数据
//    public List<Student> showAllStudent(Student student){
//        return studentDao.showAllStudent(student);
//    }

    public StudentDao getStudentDao() {
        return studentDao;
    }

    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }
}
